import http from ".."

enum Api {
    adminsUrl = '/api/admins/backstage/',
    updatePasswordUrl = '/api/admins/update_password/',
    adminsRecordUrl = '/api/record/admins/'
}

// 获取管理员列表
export async function getAdminsApi(parms) {
    return await http.get(Api.adminsUrl, parms)
}
// 修改管理员密码
export async function updatePasswordApi(parms: any) {
    return await http.post(Api.updatePasswordUrl, parms)
}
// 获取管理员日志
export async function getAdminsRecordApi(parms) {
    return await http.get(Api.adminsRecordUrl, parms)
}
// 添加管理员
export async function postAdminApi(parms: any) {
    return await http.post(Api.adminsUrl, parms)
}
// 修改管理员
export async function putAdminApi(id: string | number, parms: any) {
    return await http.put(Api.adminsUrl, id, parms)
}
// 删除管理员
export async function delAdminApi(id: string | number) {
    return await http.delete(Api.adminsUrl, id)
}
